import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 沈明月
 * Date: 2022-11-02
 * Time: 22:03
 */
public class TestSeventeen {
//求和的重载
//在同一个类中,分别定义求 两个整数的和 和 三个小数之和的方法。并执行代码，求出结果
    public static int SUM(int a, int b){
        return a+b;
    }
    public static double SUM(double a, double b, double c){
        return a+b+c;
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //求两个整数的和：
        System.out.println("请输入两个整数：");
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int sum1 = SUM(a,b);
        System.out.println("这两个整数的和是："+sum1);

        //求三个小数的和：
        System.out.println("请输入三个小数：");
        double c = scanner.nextDouble();
        double d = scanner.nextDouble();
        double e = scanner.nextDouble();
        double sum2 = SUM(c,d,e);
        System.out.println("这三个小数的和是："+sum2);
    }
}
